import React from 'react';
import { Router, Route } from 'dva/router';
import App from '../../client/App.jsx';
import About from './About';
import Container from './Container';

// export const routes = (
//   <Route path="" component={Container}>
//     <Route path="/" namespace="user" component={App} />
//     <Route path="/about" namespace="about" component={About} />
//   </Route>
// );

export const routes = [
  {
    // type: "custumProps",
    path: "/about",
    component: About,
    // desc: "11",
    exact: true,
    key: "HOME1"
    // namespace: ["releaseResources"]
  },
  {
    // type: "custumProps",
    path: "/",
    component: App,
    // desc: "管理后台开发中，敬请期待…",
    exact: true,
    key: "HOME"
    // namespace: ["releaseResources"]
  }
]


export default function ({ history }) {
  // A <Router> may have only one child element
  return (
    <Router history={history}>
      <div>
        {routes.map((el, k) => {
          return <Route {...el} />
        })}
      </div>
      {/* {routes} */}
    </Router>
  );
}